package me.jiatao.hilt.di


import android.content.Context
import android.widget.Toast
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

class AppDataBase(private val application: Context) {
    fun showInfo() {

        Toast.makeText(application, "Hello", Toast.LENGTH_LONG).show()
    }
}

@Module
@InstallIn(SingletonComponent::class)
class RoomModule {
    @Provides
    @Singleton
    fun provideAppDataBase(@ApplicationContext application: Context): AppDataBase {
        return AppDataBase(application)
    }

}